﻿<%@ Page Title="" Language="C#" MasterPageFile="~/Administrador.Master" AutoEventWireup="true" CodeBehind="UI_EditPublishModule.aspx.cs" Inherits="Espam.Idiomas.Decimo.Tesis.Web.UI_EditPublishModule" %>

<%@ Register Assembly="AjaxControlToolkit" Namespace="AjaxControlToolkit" TagPrefix="cc1" %>
<asp:Content ID="Content1" ContentPlaceHolderID="head" runat="server">
</asp:Content>
<asp:Content ID="Content2" ContentPlaceHolderID="Contenido" runat="server">
    <script type="text/javascript">
        window.onload = function () {
            var seconds = 3;
            setTimeout(function () {
                document.getElementById("<%=lblvalida.ClientID %>").style.display = "none";
            }, seconds * 1000);
        };
    </script>
     <script type="text/javascript">
         function openModal() {
             $('#flexModal').modal('show');
         }
</script>
    <cc1:ToolkitScriptManager ID="ToolkitScriptManager1" runat="server">
    </cc1:ToolkitScriptManager>
    <div id="page-wrapper">
        <div class="page-content">

            <div class="row">
                <div class="col-lg-12">
                    <div class="page-title">
                        <h1>M&oacute;dulos
                                <small>Publicar M&oacute;dulo</small>
                        </h1>
                        <ol class="breadcrumb">
                            <li class="active">
                                <asp:Label ID="lblvalida" runat="server" Text=""></asp:Label></li>
                            <li class="pull-right">
                                <div id="reportrange" class="btn btn-green btn-square date-picker">
                                    <i class="fa fa-calendar"></i>
                                    <span class="date-range"></span><i class="fa fa-caret-down"></i>
                                </div>
                            </li>
                        </ol>
                    </div>
                </div>
                <!-- /.col-lg-12 -->
            </div>
          

        </div>

        <!-- end PAGE TITLE ROW -->

        <div class="row">
            <!-- Validation Examples -->
            <div class="col-lg-12">
                <div class="portlet portlet-default">
                    <div class="portlet-heading">
                        <div class="portlet-title">
                            <h4>Datos Módulos a Editar Publicación</h4>
                        </div>
                        <div class="portlet-widgets">
                            <a data-toggle="collapse" data-parent="#accordion" href="#validationExamples"><i class="fa fa-chevron-down"></i></a>
                        </div>
                        <div class="clearfix"></div>
                    </div>
                    <div id="validationExamples" class="panel-collapse collapse in">
                        <div class="portlet-body">

                            <div class="portlet-body">
                                <div class="table-responsive">
                                    <div runat="server" id="idMensajePublicar" visible="false">
                                        <h1 align="center">
                                            <asp:Label ID="lblMensajeErrorPublicar" runat="server" Text=""></asp:Label></h1>
                                    </div>
                                    <table class="table" runat="server" id="tablaPublicar">
                                        <thead>
                                            <tr>
                                                <td>Ciclo:</td>
                                                <td>
                                                    <asp:Label ID="lblCiclo" runat="server" Text="Ciclo" CssClass="form-control"></asp:Label></td>
                                             
                                                <td>Tipo Módulo:</td>
                                                 <td>
                                                   
                                                            <asp:DropDownList ID="ddlTipoModulo" runat="server" CssClass="form-control" OnSelectedIndexChanged="ddlTipoModulo_SelectedIndexChanged"  ></asp:DropDownList>
                                                            <asp:RequiredFieldValidator ID="RequiredFieldValidator7" runat="server" ErrorMessage="Campo Obligatorio" ControlToValidate="ddlTipoModulo" ForeColor="Red"></asp:RequiredFieldValidator>
                                                        
                                                </td>

                                            </tr>
                                        </thead>
                                        <tbody>
                                            <tr runat="server" id="tipoModulo">
                                             <td>Nivel:</td>
                                                <td>
                                                    <asp:DropDownList ID="ddlNivel" runat="server" CssClass="form-control" OnSelectedIndexChanged="ddlNivel_SelectedIndexChanged"></asp:DropDownList>
                                                    <asp:RequiredFieldValidator ID="RequiredFieldValidator2" runat="server" ErrorMessage="Campo Obligatorio" ControlToValidate="ddlNivel" ForeColor="Red"></asp:RequiredFieldValidator>
                                                </td>
                                                <td></td>
                                                <td></td>
                                             </tr>
                                            <tr runat="server" id="fila1">
                                                <td>fecha Inicio:</td>
                                                <td>
                                                    <asp:TextBox ID="txtFechaInicio" placeholder="aaaa/mm/dd" autocomplete="off" runat="server" CssClass="form-control" ValidationGroup="modulo"></asp:TextBox>
                                                    <asp:RequiredFieldValidator ID="RequiredFieldValidator3" runat="server" ErrorMessage="Campo Obligarotio" ControlToValidate="txtFechaInicio" ForeColor="Red"></asp:RequiredFieldValidator>
                                                    <cc1:CalendarExtender PopupButtonID="fInicio" TargetControlID="txtFechaInicio" runat="server" ID="CalendarFechaInicio" Format="yyyy/MM/dd">
                                                    </cc1:CalendarExtender>
                                                    <cc1:FilteredTextBoxExtender ID="FilteredTextBoxExtender3" runat="server" FilterType="Numbers, Custom" ValidChars="/" TargetControlID="txtFechaInicio"></cc1:FilteredTextBoxExtender>

                                                </td>
                                                <td>Fecha Fin:</td>
                                                <td>
                                                    <asp:TextBox ID="txtFechaFin" placeholder="aaaa/mm/dd" autocomplete="off" runat="server" CssClass="form-control" ValidationGroup="modulo"></asp:TextBox>
                                                    <asp:RequiredFieldValidator ID="RequiredFieldValidator4" runat="server" ErrorMessage="Campo Obligarotio" ControlToValidate="txtFechaFin" ForeColor="Red"></asp:RequiredFieldValidator>
                                             
                                                    <cc1:CalendarExtender PopupButtonID="fFin" TargetControlID="txtFechaFin" runat="server" Format="yyyy/MM/dd"></cc1:CalendarExtender>
                                                </td>
                                            </tr>
                                            <tr runat="server" id="fila2">
                                                <td>Hora Inicio:</td>
                                                <td>
                                                    <asp:TextBox ID="txtHoraInicio" autocomplete="off" runat="server" CssClass="form-control" placeholder="ej. 12:00:00" Style="text-transform: uppercase" MaxLength="8"></asp:TextBox>
                                                    <cc1:FilteredTextBoxExtender ID="FilteredTextBoxExtender1" runat="server" TargetControlID="txtHoraInicio" FilterType="Numbers,Custom" ValidChars=":"></cc1:FilteredTextBoxExtender>
                                                    <asp:RequiredFieldValidator ID="RequiredFieldValidator1" runat="server" ErrorMessage="Campo Obligatorio" ControlToValidate="txtHoraInicio" ForeColor="Red" ToolTip="Ingrese el numero de ciclo"></asp:RequiredFieldValidator>
                                                </td>
                                                <td>Hora Fin:</td>
                                                <td>
                                                    <asp:TextBox ID="txtHoraFin" autocomplete="off" runat="server" CssClass="form-control" placeholder="ej. 01:00:00" ValidationGroup="modulo" Style="text-transform: uppercase" MaxLength="8"></asp:TextBox>
                                                    <cc1:FilteredTextBoxExtender ID="FilteredTextBoxExtender2" runat="server" FilterType="Numbers, Custom" ValidChars=":" TargetControlID="txtHoraFin"></cc1:FilteredTextBoxExtender>
                                                    <asp:RequiredFieldValidator ID="RequiredFieldValidator5" runat="server" ErrorMessage="Campo Obligatorio" ControlToValidate="txtHoraFin" ForeColor="Red"></asp:RequiredFieldValidator>
                                                </td>

                                            </tr>
                                            <tr runat="server" id="fila3">
                                                <td></td>
                                                <td></td>
                                                <td><asp:Button ID="btnCancelar" runat="server" Text="Cancelar" Visible="false" CssClass="btn btn-block" /></td>
                                                <td><asp:Button ID="btnPublicarModulo" runat="server" Text="Editar Publicación" CssClass="btn btn-dark-blue" OnClick="btnPublicarModulo_Click" /></td>
                                            </tr>
                                        </tbody>
                                    </table>
                                </div>
                            </div>
                        </div>
                    </div>
                </div>
            </div>
            <!-- /.col-lg-12 -->
            <!-- End Validation Examples -->
        </div>
        <!-- /.row -->
        <div class="row">
            <!-- Validation Examples -->
            <div class="col-lg-12">
                <div class="portlet portlet-default">
                    <div class="portlet-heading">
                        <div class="portlet-title">
                            <h4>Módulos A Publicar</h4>
                        </div>
                        <div class="clearfix"></div>
                    </div>
                    <div id="Div1" class="panel-collapse collapse in">
                        <div class="portlet-body">

                            <div class="portlet-body">

                                <div class="table-responsive">
                                    <div runat="server" id="divMensajeError" visible="false">
                                        <h1 align="center">
                                            <asp:Label ID="lblMensaje" runat="server" Text=""></asp:Label></h1>
                                    </div>
                                  
                                    <asp:UpdatePanel ID="upanel" runat="server">
                                        <ContentTemplate>
                                        <asp:GridView ID="gvModulos" Width="100%" runat="server"
                                            AutoGenerateColumns="False" CellPadding="4" GridLines="Horizontal" DataKeyNames="idModulo"
                                            BackColor="White" BorderColor="#336666"
                                            BorderStyle="Double" BorderWidth="3px" OnRowCommand="gvModulos_RowCommand">
                                            <Columns>
                                                <asp:BoundField DataField="horario" HeaderText="HORARIO">
                                                    <HeaderStyle HorizontalAlign="Center" />
                                                </asp:BoundField>
                                                <asp:BoundField DataField="codigo" HeaderText="CODIGO">
                                                    <HeaderStyle HorizontalAlign="Center" />
                                                </asp:BoundField>
                                                <asp:BoundField DataField="ubicacion" HeaderText="UBICACION">
                                                    <HeaderStyle HorizontalAlign="Center" />
                                                </asp:BoundField>
                                                <asp:BoundField DataField="docente" HeaderText="DOCENTE">
                                                    <HeaderStyle HorizontalAlign="Center" />
                                                </asp:BoundField>
                                                 <asp:ButtonField ButtonType="Button"  CommandName="editCupos" DataTextField="cupos" HeaderText="CUPOS" Text="CUPOS" />
                                            </Columns>
                                            <FooterStyle BackColor="White" ForeColor="#333333" />
                                            <HeaderStyle BackColor="#336666" Font-Bold="True" ForeColor="White" />
                                            <PagerStyle BackColor="#336666" ForeColor="White" HorizontalAlign="Center" />
                                            <RowStyle BackColor="White" ForeColor="#333333" />
                                            <SelectedRowStyle BackColor="#339966" Font-Bold="True" ForeColor="White" />
                                            <SortedAscendingCellStyle BackColor="#F7F7F7" />
                                            <SortedAscendingHeaderStyle BackColor="#487575" />
                                            <SortedDescendingCellStyle BackColor="#E5E5E5" />
                                            <SortedDescendingHeaderStyle BackColor="#275353" />
                                        </asp:GridView>
                                            </ContentTemplate>
                                        </asp:UpdatePanel>
                                  <%--  </table>--%>
                                </div>
                            </div>
                            <%--</form>--%>
                        </div>
                    </div>
                </div>
            </div>
            
        </div>

         <div class="modal modal-flex fade" id="flexModal" tabindex="-1" role="dialog" aria-labelledby="flexModalLabel" aria-hidden="true" >
        <div class="modal-dialog" >
            <div class="modal-content">
                <div class="modal-header">
                    <button type="button" class="close" data-dismiss="modal" aria-hidden="true">&times;</button>
                    <h4 class="modal-title" id="flexModalLabel">MODIFICAR LOS CUPOS DISPONIBLES</h4>
                </div>
               
                <asp:UpdatePanel ID="UpdatePanel1" runat="server">
                 <ContentTemplate>
                      <div class="modal-body" >
                          <table align="center">
                              <tr>
                                <td><asp:Label ID="lblCuposMod" runat="server" Text="CUPOS: "></asp:Label></td>
                                  <td> &nbsp;&nbsp;&nbsp;&nbsp; </td>
                                  <td><asp:TextBox ID="txtCuposMod" runat="server" CssClass="text-blue" ></asp:TextBox></td>
                                <td><asp:HiddenField ID="HfDeleteID" runat="server"/></td>
                              </tr>
                          </table>
                        </div>
                     
                      <div class="modal-footer">
                      
                          <button  class="btn btn-green"data-dismiss="modal"aria-hidden="true">Cancelar</button>
                          <asp:Button ID="btnCambiarCupos" runat="server" Text="Confirmar" CssClass="btn btn-blue" OnClick="btnCambiarCupos_Click" />
                      </div>
                 </ContentTemplate>
                 <Triggers>
                     <asp:AsyncPostBackTrigger ControlID="btnCambiarCupos" />
                 </Triggers>
             </asp:UpdatePanel>
            </div>
            <!-- /.modal-content -->
        </div>
        <!-- /.modal-dialog -->
    </div>
       
    </div>
</asp:Content>
